<template>
  <div class="home">
    <router-view />
    <div class="footer">
        <div v-for="item in navList" :key="item.id" @click="link(item.path)">
            <img :src="$route.path == item.path?item.img_hover:item.img" alt="">
            <span :class="$route.path == item.path?'active':''">{{item.name}}</span>
        </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      navList: [
        { path: "/toApply", name: "我要报名", img: require("../../iconfont/huojian.png"), img_hover: require("../../iconfont/huojian-hover.png") },
        { path: "/my", name: "个人中心", img: require("../../iconfont/my.png"), img_hover: require("../../iconfont/my-hover.png") },
      ],
    };
  },
  methods:{
      link(path){
          if(this.$route.path !== path){
              this.$router.push(path)
          }
      }
  }
};
</script>

<style lang="scss" scoped>
.footer{
    width: 100%;
    height: 65px;
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    padding: 0px 40px;
    padding-top: 5px;
    text-align: center;
    border-top: 1px solid #F2F2F2;
    img{
        width: 30px;
        height: 30px;
    }
    span{
        display: block;
        font-size: 13px;
    }
    .active{
        color: #0E9CFF;
    }
}
</style>